****************************************************** Do file for "Strategic Citation" paper (09/24/10) ******************************************************cd "Working Folder"clearlog using "sc_log.smcl", replace******************************************************************************************* Obtain "pat63_02f.dta" from http://www.econ.berkeley.edu/~bhhall/patents.html          ** This code cleans that data and creates a .dta file containing annual patent portfolios ** Create a folder called "Portfolios" to contain temporary .dta files                    *******************************************************************************************clearset mem 1000muse "Source Files/pat63_02f.dta"* Clean the data file "pat63_02f.dta"drop if gyear==.drop if cat==.drop if subcat==.drop if assignee==.sort patentsave "Temp Files/pat63_02f_clean.dta", replace* While loop to create annual patent portfolios for 1980-2002 local count = 2002while `count' >= 1980 {	clear	use "Temp Files/pat63_02f_clean.dta"	drop appyear asscode cat cgen citngyr claims cncites country gdate genindex genindip genindsub ipc4 ipcsub ncites nclass oldorgno postate subcat ussubcl 	drop if gyear > `count'	collapse (count) patent, by(assignee)	rename patent portfolio	gen year= `count'	sort assignee year	save "Portfolios/portfolio_`count'.dta", replace	local count = `count' - 1}* Combine the annual patent portfolio data into one fileclearset mem 1000muse "Portfolios/portfolio_2002.dta"local count = 2001while `count'>=1980 {	append using "Portfolios/portfolio_`count'.dta"	local count = `count' - 1}sort assignee yearsave "Portfolios/annual_portfolios.dta", replace******************************************************************************************************************************************************************************** Obtain "cite75_02.dta" from http://www.econ.berkeley.edu/~bhhall/patents.html     ** This code cleans that data and adds grant year and assignee data to it            **************************************************************************************clearset mem 1000muse "Source Files/cite75_02.dta"drop if citing==.drop if cited==.duplicates droprename citing patentsort patentmerge patent using "Temp Files/pat63_02f_clean.dta", keep(gyear assignee) nokeeptabulate _mergerename assignee citing_orgnorename patent citingdrop if _merge==1drop _mergesort citing_orgno citedsave "Temp Files/cite75_02_gyear_orgno.dta", replacerename citing patentsort patent citedsave "Temp Files/cite75_02_gyear_orgno_resorted.dta", replace******************************************************************************************************************************************************************** This code imports and cleans the NBER inventor data file (ainventor.csv)   ** from http://www.nber.org/cgi-bin/printit?uri=/patents/                     *******************************************************************************clearinsheet using "Source Files/ainventor.txt"rename lastnam inventor_secondrename firstnam inventor_firstduplicates drop patent inventor_second inventor_first, forcesort patent inventor_second inventor_firstsave "Temp Files/NBER_75_99_inventor_clean.dta", replace******************************************************************************clear set mem 1500mset matsize 800cd "Working Folder"******************************************************************************* Begin with my data on 2001-02 citation pairs and the identity of the citer *******************************************************************************use "Source Files/01-02_citations_output.dta" duplicates dropunique citing**************************************************************************************************** Merge application year, grant year and assignee identifier data for "citing" using Hall dataset ****************************************************************************************************rename citing patentsort patentmerge patent using "Temp Files/pat63_02f_clean.dta", keep(appyear gyear assignee) nokeeptabulate _merge*********************************************************** Drop if citation pair not matched in the Hall data set ***********************************************************drop if _merge==1drop _mergerename patent citingunique citing* Rename citing variablesrename appyear citing_appyearrename assignee citing_orgnorename gyear citing_gyear* Drop if no company/assignee identifieddrop if citing_orgno==0unique citing********************************************** Merge data for "cited" using NBER dataset **********************************************rename cited patentsort patentmerge patent using "Temp Files/pat63_02f_clean.dta", keep(gyear assignee) nokeeprename patent citedtabulate _mergedrop _merge* Rename cited variablesrename gyear cited_gyearrename assignee cited_orgno* Drop if no company/assignee identifieddrop if cited_orgno==.drop if cited_orgno==0unique citing*********************************************************************** Remove irrelevant citations:                                       ** (1) self-cites                                                     *	* (2) citations made to patents granted on or after application year ** (3) citations made to patents granted before 1975                  ** (4) citations from patents applied for before 1980                 ************************************************************************ Drop if self-citedrop if citing_orgno==cited_orgnounique citing* Drop if cited patent granted after applicationdrop if cited_gyear>=citing_appyearunique citing* Drop if cited patent granted before 1975 (inventor data begins in 1975)drop if cited_gyear < 1975unique citing* Drop if citing patent applied for before 1980drop if citing_appyear < 1980save "Temp Files/temp.dta", replace******************************************************************************** Merge with cite75_02_gyear_orgno.dta and drop pairs not in the Hall dataset ********************************************************************************summrename citing_gyear gyearrename citing patentsort patent citedmerge patent cited  using "Temp Files/cite75_02_gyear_orgno_resorted.dta", nokeeptabulate _mergedrop if _merge==1drop _mergerename patent citingdrop gyear* Get patent and year_citedrename citing patentsort citing_orgno citedunique patent*********************************************************************************** Expand to include all the patents issued to the citing firm that cited "cited" ***********************************************************************************joinby citing_orgno cited using "Temp Files/cite75_02_gyear_orgno.dta"unique patentsave "Temp Files/temp.dta", replacerename citing year_cited_patentrename patent citingrename gyear year_citedcount if citing==year_cited_patent* Drop if the patent citing "cited" is the observation patentdrop if year_cited>=citing_appyeardrop if citing==year_cited_patentsave "Temp Files/temp2.dta", replace*********************************************** Get inventor names for observation patents ***********************************************rename citing patentsort patent* Create one observation per inventor for each "citing" patentjoinby patent using "Source Files/01-02_inventor_revised.dta"rename patent citingsave "Temp Files/temp3.dta", replacerename year_cited_patent patentdrop if inventor_second==""drop identity citing_appyear citing_orgno cited_gyear cited_orgno midname********************************************************************************** Check if there is a common inventor using two .dta files of patents/inventors **********************************************************************************sort patent inventor_second inventor_firstmerge patent inventor_second inventor_first using "Source Files/00-02_inventor_revised.dta", keep() nokeeptabulate _mergegen flag=0replace flag=1 if _merge==3drop _mergesort patent inventor_second inventor_firstmerge patent inventor_second inventor_first using "Temp Files/NBER_75_99_inventor_clean.dta", nokeeptabulate _mergesave "Temp Files/temp4.dta", replacereplace flag=1 if _merge==3drop _mergesave "Temp Files/temp.dta", replace********************************************************************************** Create a file indicating the patent previously citing "cited"drop if flag==0save "Temp Files/patent_link.dta", replaceuse "Temp Files/temp.dta"********************************************************************************** Create a file of previous patents with same attorney AND overlapping inventor **********************************************************************************drop if flag==0drop year_cited inventor_second inventor_first midname flag midnam modifnam street city postate country zip invseqsave "Temp Files/temp2.dta", replaceduplicates droprename patent p2rename citing patentsort patentmerge patent using "Source Files/01-02_attorneys.dta", nokeeptabulate _mergedrop _mergerename patent p1rename attorney attorney1rename p2 patentsort patentmerge patent using "Source Files/prior_attorneys.dta", nokeeptabulate _mergerename attorney attorney2rename patent p2outfile p1 attorney1 p2 attorney2 using "Python Scripts/input.out", wide replace****************************************** perl -i -pe 's/\015/\012/g' input.out * * Run python script "match.py"          ** input file is "input.out"             ** output file is "out_file.txt"         ******************************************clearinsheet using "Python Scripts/output_file.txt"rename v5 attorney_overlapduplicates dropsort p1 p2save "Temp Files/common_attorney.dta", replaceclearuse "Temp Files/temp2.dta"rename citing p1rename patent p2sort p1 p2merge p1 p2 using "Temp Files/common_attorney.dta", keep(attorney_overlap) nokeeptabulate _mergedrop _mergesumm attorney_overlaprename p1 citingrename p2 patentduplicates dropcollapse (sum) attorney_overlap, by(citing cited)rename attorney_overlap num_attorney_overlapssort citing citedsave "Temp Files/common_attorney_overlaps.dta", replace************************************************************************************************************************************************* Generate a count of the number of overlapping inventors and ** a .dta file to check that patents were in fact cited by the ** firm previously                                             ****************************************************************clearuse "Temp Files/temp.dta"duplicates dropsort patentsave "Temp Files/prior_citing_pats.dta", replaceoutfile patent using "Temp Files/pat_list", wide replaceuse "Temp Files/temp.dta"* Create the "num_inventor_overlaps" variablecollapse (sum) flag, by(citing cited)gen inventor_overlap = 0replace inventor_overlap=1 if flag>0gen num_inventor_overlaps=flagsave "Temp Files/temp.dta", replace*************************************************************************************************************** Begin merging data to complete the main dataset ***************************************************** Get identity of the citersort citing citedmerge citing cited using "Source Files/01-02_citations_output.dta", keep(identity) nokeeptabulate _mergedrop _merge********************************************* Merge data for citing using NBER dataset *********************************************rename citing patentsort patentmerge patent using "Temp Files/pat63_02f_clean.dta", keep(appyear asscode cat country gyear nclass assignee postate subcat ussubcl) nokeeptabulate _mergedrop if cat==.* Drop if citation pair not in NBER datasetdrop if _merge==1drop _mergerename patent citingrename assignee orgno* Merge data on number of claims, primary examiner and second examiner, attorney, whether a continuation patent (?) for citingsort citing merge citing using "Source Files/01-02_patent_data.dta", nokeeptabulate _mergedrop _mergerename claims citing_claimsdrop if second>1* Rename citing variablesrename appyear citing_appyearrename asscode citing_asscoderename cat citing_catrename country citing_countryrename gyear citing_gyearrename nclass citing_nclassrename orgno citing_orgnorename postate citing_postaterename subcat citing_subcatrename ussubcl citing_ussubcl******************************************** Merge data for cited using NBER dataset ********************************************rename cited patentsort patentmerge patent using "Temp Files/pat63_02f_clean.dta", keep(appyear cat country claims gyear nclass assignee postate subcat ussubcl) nokeeptabulate _mergedrop _merge* Rename cited variablesrename appyear cited_appyearrename cat cited_catrename country cited_countryrename gyear cited_gyearrename nclass cited_nclassrename assignee cited_orgnorename postate cited_postaterename subcat cited_subcatrename ussubcl cited_ussubclrename claims cited_claims************************************************************** Get year 2000 claims data for cited using 00_claims.dta **************************************************************sort patentmerge patent using "Source Files/00_claims.dta", keep(claims) nokeeptabulate _mergereplace cited_claims=claims if _merge==3drop _mergedrop claimssort patentmerge patent using "Source Files/99_claims.dta", keep(claims) nokeep tabulate _merge replace cited_claims=claims if _merge==3 drop _merge drop claimsdrop if cited_claims==.gen log_cited_claims=log(cited_claims)**************************************************** Merge data on forward cites using fwd_cites.dta ****************************************************rename citing citedsort citedmerge cited using "Source Files/01-08_fwd_cites.dta", keep(fwd_cites) nokeeptabulate _mergereplace fwd_cites=0 if _merge==1drop _mergerename cited citingrename patent cited******************************************** Obtain patent portfolio data for citing ********************************************rename citing_orgno assigneerename citing_appyear yearsort assignee yearmerge assignee year using  "Portfolios/annual_portfolios.dta", keep(portfolio) nokeeptabulate _mergedrop _mergerename portfolio citing_pat_portfoliorename assignee citing_orgnogen log_citing_pat_portfolio=log(citing_pat_portfolio)******************************************* Obtain patent portfolio data for cited *******************************************rename cited_orgno assigneesort assignee yearmerge assignee year using "Portfolios/annual_portfolios.dta", keep(portfolio) nokeeptabulate _mergedrop _mergerename portfolio cited_pat_portfoliorename assignee cited_orgnorename year citing_appyeargen log_cited_pat_portfolio=log(1+cited_pat_portfolio)******************************************* Generate variables used in regressions *******************************************gen diffage = citing_appyear-cited_gyeargen log_diffage=log(diffage)gen not_US=0gen same_state=0replace same_state=citing_postate==cited_postate & citing_postate!=""gen log_citing_claims=log(citing_claims)gen same_subclass=0replace same_subclass=1 if citing_ussubcl==cited_ussubcl & citing_nclass==cited_nclassgen examination_time=citing_gyear-citing_appyeargen log_overlaps=log(1+num_inventor_overlaps)gen priority_var=0replace priority_var =1 if priority=="P"*********************************************************************************************************************************************** Obtain Jaffe Closeness data:	                                                      *														  ** This section creates datafiles to calculate the closeness measure based on Jaffe (1986) ********************************************************************************************sort citing_orgno cited_orgnooutfile citing_orgno cited_orgno using "Python Scripts/jaffe_pairs.raw", replacesave "Temp Files/temp.dta", replacerename citing_orgno orgnocollapse (count) identity, by(orgno)save "Temp Files/temp_orgno1.dta", replaceuse "Temp Files/temp.dta"rename cited_orgno orgnocollapse (count) identity, by(orgno)append using "Temp Files/temp_orgno1.dta"duplicates drop orgno, forcesort orgnosave "Temp Files/temp_orgno2.dta", replaceuse "Temp Files/pat63_02f_clean.dta"rename assignee orgnocollapse (count) patent, by(orgno nclass)rename patent nclass_patentssave "Temp Files/orgno_nclass_pats.dta", replacecollapse (sum) nclass_patents, by(orgno)rename nclass_patents all_patentssort orgnosave "Temp Files/orgno_all_pats.dta", replaceuse "Temp Files/orgno_nclass_pats.dta"sort orgnomerge orgno using "Temp Files/orgno_all_pats.dta"gen proportion = nclass_patents/all_patentssumm proportiondrop _mergesort orgnomerge orgno using "Temp Files/temp_orgno2.dta"tabulate _mergedrop if _merge!=3sort orgno nclass proportionoutfile orgno nclass proportion using "Python Scripts/input_data.raw", replace**************************************************** Run Jaffe closeness program:** Steps:* (1) cp jaffe_pairs.raw jaffe_pairs.txt* (2) cp input_data.raw input_data.txt * (3) perl -i -pe 's/\015/\012/g' input_data.txt* (4) perl -i -pe 's/\015/\012/g' jaffe_pairs.txt* (5) python closeness_2.py -c***************************************************clearinsheet using "Python Scripts/output_closeness2.txt"rename v1 citing_orgnorename v2 cited_orgnorename v3 jaffe_closenessduplicates dropsort citing_orgno cited_orgnosave "Temp Files/jaffe_closeness_revised.dta", replaceuse "Temp Files/temp.dta"merge citing_orgno cited_orgno using "Temp Files/jaffe_closeness_revised.dta", keep(jaffe_closeness) nokeeptabulate _mergedrop _mergereplace jaffe_closeness=0 if jaffe_closeness==.save "Temp Files/temp.dta", replace*********************************************************** Fix Primary Examiner names:				             ** This code corrects for mis-spellings of examiner names ***********************************************************outfile primary_first primary_second using "Python Scripts/names.raw", replacesave "Temp Files/temp.dta", replaceclear all********************************************************* Run collapse names program:** Steps:* (1) cp names.raw names.txt* (2) perl -i -pe 's/\015/\012/g' names.txt * (3) python collapsename.py -c* (4) python recollapse.py -c********************************************************insheet primary_examiner_first primary_examiner_second using "Python Scripts/names_combined.txt"rename primary_examiner_first namerename primary_examiner_second standardized_namesort namesave "Temp Files/collapsed_name.dta", replaceclear use "Temp Files/temp.dta"gen name=primary_first+" "+primary_secondsort namemerge name using "Temp Files/collapsed_name.dta", keep(standardized_name) nokeeptabulate _merge* No examiner listed for patent 6494025* diagnostic: list name standardized_name if name!=standardized_namedrop if _merge==1drop _merge******************************************************** Gen year, subcategory, country and category dummies ********************************************************ta citing_appyear, ge(year)ta citing_subcat, ge(subcat)ta citing_country, ge(country)ta citing_asscode, ge(asscode)ta citing_cat, ge(cat)replace not_US = asscode2****************** Data cleaning ******************drop if cited_claims==.drop if cited_appyear < 1970* Merge data on attorneyssort citing citedmerge citing cited using "Temp Files/common_attorney_overlaps.dta", keep(num_attorney_overlaps) nokeeptabulate _mergedrop _mergesumm num_attorney_overlapsgen log_attorney_overlaps=log(1+num_attorney_overlaps)save "Temp Files/current_output.dta", replace*************************************** Generate weights for all citations ***************************************save "Temp Files/current_output.dta", replacecollapse (count) cited, by(citing)rename cited weightsort citingsave "Temp Files/weight.dta", replaceuse "Temp Files/current_output.dta"sort citingmerge citing using "Temp Files/weight.dta"tabulate _mergedrop _mergegen weight_all=(1/weight)drop weightsave "Temp Files/current_output.dta", replace************************************************************** Generate weights for citations with overlapping inventors **************************************************************drop if inventor_overlap==0collapse (count) cited, by(citing)rename cited weightsort citingsave "Temp Files/weight.dta", replaceuse "Temp Files/current_output.dta"sort citingmerge citing using "Temp Files/weight.dta"tabulate _mergedrop _mergegen weight_overlap=(1/weight)drop weight*********** Labels ***********label variable log_citing_claims "(log) Claims"label variable fwd_cites "Forward Citations"label variable log_citing_pat_portfolio "(log) Patent Portfolio"label variable jaffe_closeness "TECH Closeness"label variable log_cited_pat_portfolio "(log) Cited Pat. Portfolio"label variable log_cited_claims "(log) Cited Claims"label variable attorney "Attorney"label variable same_state "Same State"label variable not_US "Non-US Firm"label variable diffage "$\Delta$ Age (Years)"label variable examination_time "Examination Time"label variable log_overlaps "(log) Common Inventors"label variable same_subclass "Same Subclass"label variable second "Second Examiner"label variable cat1 "Chemicals"label variable cat2 "Computers"label variable cat3 "Drugs"label variable cat4 "Electrical"label variable cat5 "Mechanical"save "Temp Files/current_output.dta", replacelog close************** Tables ************************************* Summary statistics ***********************sutex citing_appyear cited_appyear citing_gyear cited_gyear identity citing_claims fwd_cites citing_pat_portfolio jaffe_closeness  cited_pat_portfolio cited_claims  same_state diffage same_subclass attorney  not_US  examination_time num_inventor_overlaps second if parent!="C", digits(2)sutex citing_appyear cited_appyear citing_gyear cited_gyear identity citing_claims fwd_cites citing_pat_portfolio jaffe_closeness  cited_pat_portfolio cited_claims  same_state diffage same_subclass attorney  not_US  examination_time num_inventor_overlaps second  if inventor_overlap==1 & parent!="C", digits(2)**************** By category ****************sort citing_catby citing_cat: summ identityby citing_cat: summ identity if inventor_overlap==1by citing_cat: summ identity if parent!="C"by citing_cat: summ identity if inventor_overlap==1 & parent!="C"by citing_cat: summ identity if not_US==0 & parent!="C"by citing_cat: summ identity if inventor_overlap==1 & not_US==0 & parent!="C"****************************** Difference in means table ******************************ttest citing_claims if parent!="C", by(identity)ttest fwd_cites if parent!="C", by(identity)ttest citing_pat_portfolio if parent!="C", by(identity)ttest citing_claims if inventor_overlap==1 & parent!="C", by(identity)ttest fwd_cites if inventor_overlap==1 & parent!="C", by(identity)ttest citing_pat_portfolio if inventor_overlap==1 & parent!="C", by(identity)ttest citing_claims if inventor_overlap==1 & parent!="C" & num_attorney_overlaps>0, by(identity)ttest fwd_cites if inventor_overlap==1 & parent!="C" & num_attorney_overlaps>0, by(identity)ttest citing_pat_portfolio if inventor_overlap==1 & parent!="C" & num_attorney_overlaps>0, by(identity)**************** Regressions ****************************************** Table 4: Main results **************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps if parent!="C" [weight=weight_all], cluster(citing) estimates store est1reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps cat1-cat5 if parent!="C" [weight=weight_all], cluster(citing) estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps subcat1-subcat37 if parent!="C" [weight=weight_all], cluster(citing) estimates store est3areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney  examination_time log_overlaps subcat1-subcat37 if parent!="C" [weight=weight_all], cluster(citing) absorb(citing_orgno)estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")*********************************** Table 5: By technical subclass ***********************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage  attorney not_US examination_time log_overlaps subcat* if citing_cat==1 & parent!="C" [weight=weight_all], cluster(citing)estimates store est1reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage   attorney not_US examination_time log_overlaps  subcat* if citing_cat==2 & parent!="C" [weight=weight_all], cluster(citing)estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage   attorney not_US examination_time log_overlaps  subcat* if citing_cat==3 & parent!="C" [weight=weight_all], cluster(citing)estimates store est3reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage  attorney not_US examination_time log_overlaps subcat* if citing_cat==4 & parent!="C" [weight=weight_all], cluster(citing)estimates store est4reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage  attorney not_US examination_time log_overlaps  subcat* if citing_cat==5 & parent!="C" [weight=weight_all], cluster(citing)estimates store est5estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")****************************** Table 6: Inventor-overlap ******************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing) estimates store est1reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps cat1-cat5 if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing) estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing) estimates store est3areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney   examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing) absorb(citing_orgno)estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")************************************************* Table 7: Inventor-overlap & attorney-overlap *************************************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" & num_attorney_overlaps>0 [weight=weight_overlap], cluster(citing) estimates store est1areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" & num_attorney_overlaps>0 [weight=weight_overlap], cluster(citing) absorb(citing_orgno)estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US   examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" & num_attorney_overlaps==0  [weight=weight_overlap], cluster(citing) estimates store est3areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney  examination_time log_overlaps subcat1-subcat37 if inventor_overlap==1 & parent!="C" & num_attorney_overlaps==0  [weight=weight_overlap], cluster(citing) absorb(citing_orgno)estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")************************************** Table 8: Examiner characteristics **************************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage same_subclass second attorney not_US   examination_time log_overlaps  subcat* if parent!="C" [weight=weight_all], cluster(citing) estimates store est1areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage same_subclass second attorney not_US   examination_time log_overlaps  subcat* if parent!="C" [weight=weight_all], cluster(citing)  absorb(standardized_name)estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage same_subclass second attorney not_US   examination_time log_overlaps  subcat* if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing)  estimates store est3areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage same_subclass second attorney not_US   examination_time log_overlaps  subcat* if inventor_overlap==1 & parent!="C" [weight=weight_overlap], cluster(citing) absorb(standardized_name)estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")************************************** Table 9: Non-US / US subsamples   **************************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims same_state diffage attorney not_US  examination_time log_overlaps subcat* if not_US==1 & parent!="C" [weight=weight_all], cluster(citing) estimates store est1areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney  examination_time log_overlaps subcat* if not_US==1 & parent!="C" [weight=weight_all], cluster(citing)  absorb(citing_orgno)estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps subcat* if not_US==0 & parent!="C" [weight=weight_all], cluster(citing) estimates store est3areg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney   examination_time log_overlaps subcat* if not_US==0 & parent!="C" [weight=weight_all], cluster(citing) absorb(citing_orgno)estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")*************************************** Table 10: <= 100 and >=100 patents ***************************************reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps subcat* if parent!="C" & citing_pat_portfolio <= 100 [weight=weight_all], cluster(citing)estimates store est1reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps subcat* if parent!="C" & citing_pat_portfolio > 100 [weight=weight_all], cluster(citing) estimates store est2reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps subcat* if parent!="C" & citing_pat_portfolio <= 100 & inventor_overlap==1 [weight=weight_overlap], cluster(citing) estimates store est3reg identity log_citing_claims fwd_cites log_citing_pat_portfolio jaffe_closeness log_cited_pat_portfolio log_cited_claims  same_state diffage attorney not_US  examination_time log_overlaps subcat*   if parent!="C" & citing_pat_portfolio > 100 & inventor_overlap==1  [weight=weight_overlap], cluster(citing)  estimates store est4estout est1 est2 est3 est4, cells("b(star fmt(%9.3f)) se(par fmt(%9.3f))") margin stats(r2_a N, fmt(%9.3f %9.0f) labels("Adj. \$R^2\$" "No. of observations"))  label msign(--) nolz varwidth(16) modelwidth(13) style(tex)  title(TITLE HERE\label{auto}) varlabels(_cons Constant)  mlabels(, span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}\caption{@title}" "\begin{center}" "\begin{tabular}{l*{@M}{rr}}" "\hline") posthea (\hline)  prefoot(\hline) postfoot("\hline" "\small\textit{Notes: NOTES HERE}  "  "\end{tabular}" "\end{center}" "\end{table}")************************** Generating the charts **************************drop if parent=="C"collapse (count) cited, by(citing)histogram cited if cited<=15, discrete percentdrop if parent=="C"duplicates drop citing, forcehistogram fwd_cites if fwd_cites<=30, discrete percent